*************************************************************************
***Robustness Checks and Sensitivity Tests for 
***Arndt, C, Jensen, C. and Wenzelburger, G(2020): Voters’ Wrath? Policy change and government popularity - accepted for publication in Governance

***These commands produce the Tables and Figures for the empirical analysis appearing the appendix, part B, the names of the drives and folders might obviously be different on your computer/device
***The references to figures indicate figures that appear in the online appendix, part B containing the robustness and sensitivity tests
***please use the dataset "Policy_data_PB_timeseries_all_11April" since it contains all precoded variables and the macro-level data on reforms
***please also read all comments and remarks before the respective commands to identify the location of each robustness check





**************************Simultaneous Modelling of Reforms************************************************

***baseline pensions, larger reforms, appears in Table B1, M1
mlogit defection lag1_p_lnumexp lag1_p_lnumcut lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust


*one graph for expansions
margins, at(lag1_p_lnumexp=(0(1)3) lag1_p_lnumcut=0 ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1) pr(outcome(1)) pr(outcome(3))

*color
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("Number of expansions in month before", size(medium) color(black) height(5)) ///
ylabel(0 "0" .1 "10" .2 "20" .3 "30", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(red) fintensity(60)) ci2opts(color(ltblue)) ///
plot1opts(lcolor(cranberry) mcolor(cranberry) msymbol(square)) plot2opts(lcolor(blue) mcolor(blue) msymbol(triangle)) ///
unique name("p_lnumexp_govdef_n", replace)

*bw
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("Number of expansions in month before", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .2 "20", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs12)) ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(triangle)) ///
unique name("p_lnumexp_govdef_n_bw", replace)


*one graph for cuts
margins, at(lag1_p_lnumexp=0 lag1_p_lnumcut=(0(1)3) ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1) pr(outcome(1)) pr(outcome(3))

*color
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("Number of cutbacks in month before", size(medium) color(black) height(5)) ///
ylabel(0 "0" .1 "10" .2 "20" .3 "30", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(red) fintensity(60)) ci2opts(color(ltblue)) ///
plot1opts(lcolor(cranberry) mcolor(cranberry) msymbol(square)) plot2opts(lcolor(blue) mcolor(blue) msymbol(triangle)) ///
unique name("p_lnumcut_govdef_n", replace)

*bw
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("Number of cutbacks in month before", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .2 "20", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs12)) ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(triangle)) ///
unique name("p_lnumcut_govdef_n_bw", replace)


*Figure B1, upper panel
grc1leg p_lnumexp_govdef_n p_lnumcut_govdef_n, graphregion(color(white)) ycommon
grc1leg p_lnumexp_govdef_n_bw p_lnumcut_govdef_n_bw, graphregion(color(white)) ycommon

*for combination
grc1leg p_lnumexp_govdef_n_bw p_lnumcut_govdef_n_bw, graphregion(color(white)) ycommon ///
title("Pensions", size(medium) color(black)) name("p_base_bw", replace)


***baseline unemployment insurance, larger reforms, appears in Table B2, M1

*one graph for expansions
margins, at(lag1_ub_lnumexp=(0(1)3) lag1_ub_lnumcut=0 ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1) pr(outcome(1)) pr(outcome(3))

*color
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("Number of expansions in month before", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .20 "20" .25 "25", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(red) fintensity(60)) ci2opts(color(ltblue)) ///
plot1opts(lcolor(cranberry) mcolor(cranberry) msymbol(square)) plot2opts(lcolor(blue) mcolor(blue) msymbol(triangle)) ///
unique name("ub_lnumexp_govdef_n", replace)

*bw
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("Number of expansions in month before", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .20 "20", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs12)) ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(triangle)) ///
unique name("ub_lnumexp_govdef_n_bw", replace)


*one graph for cuts
margins, at(lag1_ub_lnumexp=0 lag1_ub_lnumcut=(0(1)3)  ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1) pr(outcome(1)) pr(outcome(3))

*color
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("Number of cutbacks in month before", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .20 "20" .25 "25", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(red) fintensity(60)) ci2opts(color(ltblue)) ///
plot1opts(lcolor(cranberry) mcolor(cranberry) msymbol(square)) plot2opts(lcolor(blue) mcolor(blue) msymbol(triangle)) ///
unique name("ub_lnumcut_govdef_n", replace)

*bw
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("Number of cutbacks in month before", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .20 "20", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs12)) ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(triangle)) ///
unique name("ub_lnumcut_govdef_n_bw", replace)

*Figure B1 lower panel
grc1leg ub_lnumexp_govdef_n ub_lnumcut_govdef_n, graphregion(color(white)) ycommon
grc1leg ub_lnumexp_govdef_n_bw ub_lnumcut_govdef_n_bw, graphregion(color(white)) ycommon

*for combination
grc1leg ub_lnumexp_govdef_n_bw ub_lnumcut_govdef_n_bw, graphregion(color(white)) ycommon ///
title("Unemployment insurance", size(medium) color(black)) name("ub_base_bw", replace)

*Combined Figure B1
grc1leg p_base_bw ub_base_bw, graphregion(color(white)) ycommon cols(1)
graph display, xsize(5.5) ysize(7.5)
graph save Graph "F:\WSCEP\Governance Paper with PB data\Figure B1.gph", replace








**************************binary models: data seperated by previous vote choice**********************************************************************

***pensions
*defection of former supporter, appears in Table B1, M2
mlogit defection lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp if govrecall==1, robust

*rewarder, appears in Table B1, M2
mlogit defection lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp if govrecall==0, robust


*with recall as further control, appears in Table B1, M3
mlogit govparty lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion i.govrecall d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust base(1)



***unemployment insurance
*defection of former supporter, appears in Table B2, M2
mlogit defection lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp if govrecall==1, robust

*rewarder, Table B2, M2
mlogit defection lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp if govrecall==0, robust


*with vote recall as further control, appears in Table B2, M3
mlogit govparty lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion i.govrecall d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust base(1)




****************************with control for government party id******************************************************
*these models contain an extra control for party identification with a government party to rule out that perception of
*reforms is driven by party identification and thus affects the reward-punishment logic found in the main analysis

***pensions, appears as M4 in Table B1
mlogit defection lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion i.pid_govparty d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust

***Unemployment insurance, appears as M4 in Table B2
mlogit defection lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion i.pid_govparty d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust




********************models with Skalometer for government performance as dv********************************************
*these models use the perceived government performance from the Politbarometer as additional dependent variable (so-called Government Skalometer). The item is an 11-point scale asking the respondents “Are you satisfied with the performance of the *Federal Government consisting of [Chancellor Party] and [Coalition Partner]. Please use the following thermometer ranging from plus 5 to minus 5. ‘Plus 5’ means that you are completely satisfied with the government’s performance. ‘Minus 5’ means that *you are completely dissatisfied with the government’s performance. You can use the values in between to indicate the level of your dissatisfaction or satisfaction more precisely.” 
*We used this item instead of our voter migration item to inspect whether we can reproduce the reward-punishment logic with a different dependent variable. Since the item on government performance is an interval scale, we used OLS-regression with robust standard errors instead of the logit models used in most other specifications.	


***base pensions, appears in Table B1, M5
reg v15 lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust

*one graph for expansions
margins, at(lag1_p_lnumexp=(0(1)3) lag1_p_lnumcut=0 ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1) 

*bw
marginsplot, ///
ytitle("Government performance", axis(1) size(medium) height(5)) ///
xtitle("Number of expansions in month before     ", size(medium) color(black) height(5)) ///
ylabel(, angle (0) labsize(medium)) ///
legend(order(2 "Government performance   ")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60))  ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) ///
unique name("p_exp_scalegov_bw", replace)

*one graph for cuts
margins, at(lag1_p_lnumexp=0 lag1_p_lnumcut=(0(1)3) ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1) 

*bw
marginsplot, ///
ytitle("Government popularity", axis(1) size(medium) height(5)) ///
xtitle("Number of cutbacks in month before", size(medium) color(black) height(5)) ///
ylabel(, angle (0) labsize(medium)) ///
legend(order(2 "Government performance")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60))  ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) ///
unique name("p_cut_scalegov_bw", replace)


grc1leg p_exp_scalegov_bw p_cut_scalegov_bw, graphregion(color(white)) ycommon ///
title("Pensions", size(medium) color(black)) name("p_base_scale_bw", replace)

***base unemployment insurance, appears in Table B2, M5
reg v15 lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust

*one graph for expansions
margins, at(lag1_ub_lnumexp=(0(1)3) lag1_ub_lnumcut=0 ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1) 

*bw
marginsplot, ///
ytitle("Government popularity", axis(1) size(medium) height(5)) ///
xtitle("Number of expansions in month before     ", size(medium) color(black) height(5)) ///
ylabel(, angle (0) labsize(medium)) ///
legend(order(2 "Government performance   ")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60))  ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) ///
unique name("ub_exp_scalegov_bw", replace)

*one graph for cuts
margins, at(lag1_ub_lnumexp=0 lag1_ub_lnumcut=(0(1)3) ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1) 

*bw
marginsplot, ///
ytitle("Government popularity", axis(1) size(medium) height(5)) ///
xtitle("Number of cutbacks in month before", size(medium) color(black) height(5)) ///
ylabel(, angle (0) labsize(medium)) ///
legend(order(2 "Government performance")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60))  ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) ///
unique name("ub_cut_scalegov_bw", replace)


grc1leg ub_exp_scalegov_bw ub_cut_scalegov_bw, graphregion(color(white)) ycommon ///
title("Unemployment insurance", size(medium) color(black)) name("ub_base_scale_bw", replace)


*Combined Figure B2
grc1leg p_base_scale_bw ub_base_scale_bw, graphregion(color(white)) ycommon cols(1)
graph display, xsize(5.5) ysize(7.5)

graph save Graph "F:\WSCEP\Governance Paper with PB data\Figure B2 Skalometer.gph", replace


******************************************************************************************************************************
***Skalometer for interaction age*pensions (not shown)
reg v15 c.lag1_p_lnumexp##i.age c.lag1_p_lnumcut##i.age class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust

*margins for expansions
margins, over(age) dydx(lag1_p_lnumexp) at(lag1_p_lnumcut=0  ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1)



*margins for cuts
margins, over(age) dydx(lag1_p_lnumcut) at(lag1_p_lnumexp=0  ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1)



****opposition: base pensions (not shown)*******
reg v16 lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust

margins, at(lag1_p_lnumexp=(0(1)3) lag1_p_lnumcut=0 ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1) 

*bw
marginsplot, ///
ytitle("Opposition popularity", axis(1) size(medium) height(5)) ///
xtitle("Number of expansions in month before", size(medium) color(black) height(5)) ///
ylabel(, angle (0) labsize(medium)) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60))  ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) ///
unique name("p_exp_scaleopp_bw", replace)

*one graph for cuts
margins, at(lag1_p_lnumexp=0 lag1_p_lnumcut=(0(1)3) ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1) 

*bw
marginsplot, ///
ytitle("Opposition popularity", axis(1) size(medium) height(5)) ///
xtitle("Number of cutbacks in month before", size(medium) color(black) height(5)) ///
ylabel(, angle (0) labsize(medium)) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60))  ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) ///
unique name("p_cut_scaleopp_bw", replace)


grc1leg p_exp_scalegov_bw p_cut_scalegov_bw, graphregion(color(white)) ycommon ///
title("Pensions", size(medium) color(black)) name("p_base_scaleopp_bw", replace)



***************with left-right item for reduced sample*******************************************************************************************************************
*M6 and M7: These models add left-right self-placement as extra control for a reduced sample size. We reconstructed an 11-point left-right scale (1 “far left” to 11 “far right”) for those surveys and years where it was available or where it could be *reconstructed based on similar questions on the degree of ones political leaning. One should note that the item is completely missing in 1977, 1978, 1979, 1981, 1984, 1985, 1986, and that is was only constantly included in the Politbarometer after *1989. We therefore decided to compare the models M7 that include the left-right variable with a base model M6 for those years where the left-right item was available.	

***Pensions
*Appears as M6 in Table B1
mlogit defection lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp if lr!=., robust
*Appears as M7 in Table B1
mlogit defection lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion lr d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp if lr!=., robust


***Unemployment insurance
*Appears as M6 in Table B2
mlogit defection lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp if lr!=., robust
*Appears as M7 in Table B2
mlogit defection lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion lr d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp if lr!=., robust



******************with alternative coding of cost of ruling************************************************************
*M8: As M0 in main text, but with an alternative measurement of the cost of ruling variable (variable: gov_cost_of_rul) where we counted the number of months a given government was in office (in total) and not the time passed since the last election (variable: cost_of_rul  as used for all other analyses). For instance, the cabinets of Chancellor *Kohl were in office for 16 years since Kohl became chancellor in 1982 by a vote of no confidence. Hence, the alternative measurement of cost of ruling therefore ranges from 0 to 192 months for Chancellor Kohl, 0 to 84 for Schröder, and 0 to 70 for* *Schmidt (counted since his first real election in 1976). 


***pensions, appears as M8 in Table B1
mlogit defection lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q gov_cost_of_rul singleevent i.gov_comp, robust

***unemployment insurance, appears as M8 in Table B2
mlogit defection lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q gov_cost_of_rul singleevent i.gov_comp, robust




**************************Sensitivity tests for endogeneity**********************************************************************
*these sensitivity tests appear in Table B3, page 24 of the online appendix and addressed reviewer comments.
*Please read the annotations on p. 24 in the online appendix for a more detailed description

***pensions

*level of government support in month/quarter before, appears in Table B3, M1
mlogit defection lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost lag2_support_gov_m singleevent i.gov_comp, robust base(0)
*Table B3, M2
mlogit defection lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost lag4_support_gov_m singleevent i.gov_comp, robust base(0)

*change in government support in month/quarter before, appears in Table B3, M3
mlogit defection lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost ld2_support_gov_m singleevent i.gov_comp, robust base(0)
*Table B3, M4
mlogit defection lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost ld4_support_gov_m singleevent i.gov_comp, robust base(0)



***unemployment insurance
*level of government support in month/quarter before, appears in Table B3, M1
mlogit defection lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost lag2_support_gov_m singleevent i.gov_comp, robust base(0)
*Table B3, M2
mlogit defection lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost lag4_support_gov_m singleevent i.gov_comp, robust base(0)

*change in government support in month/quarter before, appears in Table B3, M3
mlogit defection lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost ld2_support_gov_m singleevent i.gov_comp, robust base(0)
*Table B3, M4
mlogit defection lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost ld4_support_gov_m singleevent i.gov_comp, robust base(0)

***********************************************************************************************************************



*********************************Robustness Checks_endogeneity*********************************************************
*For the robustness checks for endogeneity on p. 25 of the online appendix please use the do-file "Robustness Checks_endogeneity"
*and the data-file "Policy_data_PB_timeseries" since these analyses are based on aggregated data
***********************************************************************************************************************





***********************************************************************************************************************
***********************************************************************************************************************




********************Random effects gov comp*class, age, union, religion***********************************************************************
**These models R1 and R2 present supplementary analysis where we allowed selected control variables and the reform variables to vary in effect across the different government constellations. R1 captures whether the effect of demographic characteristics on the probability of defecting from the incumbents varies across different governments and whether this affects our coefficients for policy change. We model this for the two historical cleavages in Germany (class and religion) as well as the well-known age effect in voting (CDU/CSU stronger among the elderly). R2 captures whether the main effect for rewarding and defecting differs if we add an interaction government constellation*reform variables.



***Pension reforms, appears in upper-panel of Table B6, Model R1 and upper-half of Figure B3
mlogit defection lag1_p_lnumexp lag1_p_lnumcut i.gov_comp##i.class occ_2 occ_3 occ_4 occ_6 i.gov_comp##i.unionv74 i.gov_comp##i.age sex edu_1 edu_2 i.gov_comp##i.religion d1_unemp_month lag1_gdp_q cost singleevent, robust

*one graph for expansions
margins, at(lag1_p_lnumexp=(0(1)3) lag1_p_lnumcut=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 sex=0 edu_1=0 edu_2=0 singleevent=0 gov_comp=1) pr(outcome(1)) pr(outcome(3))

*bw
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("Number of expansions in month before", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .2 "20", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs12)) ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(triangle)) ///
unique name("p_lnumexp_random_n_bw", replace)


*one graph for cuts
margins, at(lag1_p_lnumcut=(0(1)3) lag1_p_lnumexp=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 sex=0 edu_1=0 edu_2=0 singleevent=0 gov_comp=1) pr(outcome(1)) pr(outcome(3))

*bw
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("Number of cuts in month before", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .2 "20", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs12)) ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(triangle)) ///
unique name("p_lnumcut_random_n_bw", replace)

*for combination
grc1leg p_lnumexp_random_n_bw p_lnumcut_random_n_bw, graphregion(color(white)) ycommon ///
title("Pensions", size(medium) color(black)) name("p_random_bw", replace)



***Pension reforms, appears in upper-panel of Table B6, Model R2
mlogit defection i.gov_comp##c.lag1_p_lnumexp i.gov_comp##c.lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent, robust
outreg2 using "F:\WSCEP\Politbarometer kumuliert for WSECP\pensions_govcomp_V13.doc", alpha(0.001, 0.01, 0.05) e(ll df_m chi2) word replace




**********************************************************************************************************
***labour market reforms, appears in lower-panel of Table B6, Model R1 and lower-half of Figure B3

mlogit defection lag1_ub_lnumexp lag1_ub_lnumcut i.gov_comp##i.class occ_2 occ_3 occ_4 occ_6 i.gov_comp##i.unionv74 i.gov_comp##i.age sex edu_1 edu_2 i.gov_comp##i.religion d1_unemp_month lag1_gdp_q cost singleevent, robust

*one graph for expansions
margins, at(lag1_ub_lnumexp=(0(1)3) lag1_ub_lnumcut=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 sex=0 edu_1=0 edu_2=0 singleevent=0 gov_comp=1) pr(outcome(1)) pr(outcome(3))

*bw
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("Number of expansions in month before", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .2 "20", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs12)) ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(triangle)) ///
unique name("ub_lnumexp_random_n_bw", replace)


*one graph for cuts
margins, at(lag1_ub_lnumcut=(0(1)3) lag1_ub_lnumexp=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 sex=0 edu_1=0 edu_2=0 singleevent=0 gov_comp=1) pr(outcome(1)) pr(outcome(3))

*bw
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("Number of cuts in month before", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .2 "20", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs12)) ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(triangle)) ///
unique name("ub_lnumcut_random_n_bw", replace)

*for combination
grc1leg ub_lnumexp_random_n_bw ub_lnumcut_random_n_bw, graphregion(color(white)) ycommon ///
title("Unemployment insurance", size(medium) color(black)) name("ub_random_bw", replace)


*Combined Figure B3
grc1leg p_random_bw ub_random_bw, graphregion(color(white)) ycommon cols(1)
graph display, xsize(5.5) ysize(7.5)
graph save Graph "F:\WSCEP\Governance Paper with PB data\Figure B3.gph", replace



***labour market reforms, appears in lower-panel of Table B6, Model R2
mlogit defection i.gov_comp##c.lag1_ub_lnumexp i.gov_comp##c.lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent, robust
outreg2 using "F:\WSCEP\Governance Paper with PB data\ub_govcomp_V13.doc", alpha(0.001, 0.01, 0.05) e(ll df_m chi2) word replace





************************************************************************************************************************************************************************************
*Robustness tests for models containing interaction extreme event*policy change.
************************************************************************************************************************************************************************************
*To inspect whether potential influential cases or outliers and to substantiate our coding decisions, we dropped one event at a time to inspect 
*if the results for the extreme event*policy change interaction are driven by one single extreme event.
*These models appear in Tables B7 and B8 on pages 28 and 29 in the online appendix


***Pensions, the results appear in Table B7, the order of the results presented in Table B7 follows the order of the models below*** 

*Baseline as in main text
mlogit defection i.singleevent##c.lag1_p_lnumexp i.singleevent##c.lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp, robust

*coded as single events
*16 Nuclear Power Plants (in 1986/2011)
*36 Gulf-crisis/Iraq war
*38 Wars in (former Yugoslavia)
*46 re-unification
*73 & 82 BSE/aftosa crisis
*86 9/11 & terror against USA
*88 & 109 Erfurt Amok
*92 Flood Eastern Germany

*Without nuclear disasters Chernobyl and Fukushima
mlogit defection i.singleevent##c.lag1_p_lnumexp i.singleevent##c.lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=16, robust

*Without Gulf-crisis and Iraq War
mlogit defection i.singleevent##c.lag1_p_lnumexp i.singleevent##c.lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=36, robust

*Without wars in (former Yugoslavia)
mlogit defection i.singleevent##c.lag1_p_lnumexp i.singleevent##c.lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=38, robust

*Without re-unification
mlogit defection i.singleevent##c.lag1_p_lnumexp i.singleevent##c.lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=46, robust

*Without BSE crisis 2001
mlogit defection i.singleevent##c.lag1_p_lnumexp i.singleevent##c.lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=73, robust

*Without Aftosa crisis 2001
mlogit defection i.singleevent##c.lag1_p_lnumexp i.singleevent##c.lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=82, robust

*Without 9/11
mlogit defection i.singleevent##c.lag1_p_lnumexp i.singleevent##c.lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=86, robust

*Without Massacre Erfurt
mlogit defection i.singleevent##c.lag1_p_lnumexp i.singleevent##c.lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=88&v33!=109, robust

*Without Floods in Eastern Germany
mlogit defection i.singleevent##c.lag1_p_lnumexp i.singleevent##c.lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=92, robust



***Unemployment insurance, the results appear in Table B8, the order of the results presented in Table B8 follows the order of the models below*** 

*Baseline as in main text
mlogit defection i.singleevent##c.lag1_ub_lnumexp i.singleevent##c.lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp, robust

*coded as single events
*16 Nuclear Power Plants (in 1986/2011)
*36 Gulf-crisis/Iraq war
*38 Wars in (former Yugoslavia)
*46 re-unification
*73 & 82 BSE/aftosa crisis
*86 9/11 & terror against USA
*88 & 109 Erfurt Amok
*92 Flood Eastern Germany


*Without nuclear disasters Chernobyl and Fukushima
mlogit defection i.singleevent##c.lag1_ub_lnumexp i.singleevent##c.lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=16, robust

*Without Gulf-crisis and Iraq War
mlogit defection i.singleevent##c.lag1_ub_lnumexp i.singleevent##c.lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=36, robust

*Without wars in (former Yugoslavia)
mlogit defection i.singleevent##c.lag1_ub_lnumexp i.singleevent##c.lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=38, robust

*Without re-unification
mlogit defection i.singleevent##c.lag1_ub_lnumexp i.singleevent##c.lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=46, robust

*Without BSE crisis 2001
mlogit defection i.singleevent##c.lag1_ub_lnumexp i.singleevent##c.lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=73, robust

*Without Aftosa crisis 2001
mlogit defection i.singleevent##c.lag1_ub_lnumexp i.singleevent##c.lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=82, robust

*Without 9/11
mlogit defection i.singleevent##c.lag1_ub_lnumexp i.singleevent##c.lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=86, robust

*Without Massacre Erfurt
mlogit defection i.singleevent##c.lag1_ub_lnumexp i.singleevent##c.lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=88&v33!=109, robust

*Without Floods in Eastern Germany
mlogit defection i.singleevent##c.lag1_ub_lnumexp i.singleevent##c.lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost i.gov_comp if v33!=92, robust





******************************************Supplementary analysis for separation of the Chancellors’s Party from the Junior Coalition Partners*********************************

*One reviewer asked us to use a different dependent variable to inspect whether the Chancellor’s Party is held responsible for policy changes to a stronger degree than the junior coalition partner. We followed this advice and distinguished the Chancellors’s Party from the Junior Coalition Partner and compare this to our baseline model containing defection from and rewarding the government and dummy specification for choosing the opposition vs the government after policy changes.
*The analysis below reproduce this robustness check, appearing in Tables B9 and B10 and visualised in Figure B4, pages 30-31 in the online appendix 

*You need to rerun these commands in case the data does not already contain a seperate junior coalition partner variable
*government vote intention: seperation of Chancelor party and junior coalition, variable "govparty3"
gen govparty3=party
recode govparty3 (1=1) (3=2) (10=.) (else=0) if gov_comp==1
recode govparty3 (2=1) (4=2) (10=.) (else=0) if gov_comp==2
recode govparty3 (1=1) (2=2) (10=.) (else=0) if gov_comp==3
recode govparty3 (2=1) (3=2) (10=.) (else=0) if gov_comp==4

label define gp3 2 "Junior Coalition" 1 "Chancellor Party" 0 "Opposition", modify
label values govparty3 gp3



***pensions, larger reforms as in main text, appears as left-hand column in Table B9
mlogit defection lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust

*one graph for expansions
margins, at(lag1_p_lnumexp=(0(1)3) lag1_p_lnumcut=0 ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1) pr(outcome(1)) pr(outcome(3))


*bw
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("expansions", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .2 "20", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder") rows(2)) ///
title("", size(medsmall) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs12)) ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(triangle)) ///
unique name("p_lnumexp_govdef_n_bw2", replace)


*one graph for cuts
margins, at(lag1_p_lnumexp=0 lag1_p_lnumcut=(0(1)3) ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1) pr(outcome(1)) pr(outcome(3))


*bw
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("cutbacks", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .2 "20", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder") rows(2)) ///
title("", size(medsmall) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs12)) ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(triangle)) ///
unique name("p_lnumcut_govdef_n_bw2", replace)



*for combination with different specifications of dv
grc1leg p_lnumexp_govdef_n_bw2 p_lnumcut_govdef_n_bw2, graphregion(color(white)) ycommon ///
title("Baseline Specification", size(medium) color(black)) name("p_base2_bw", replace)




***dummy specification of dependent variable: government vs opposition, appears as middle column row in Table B9
mlogit govparty lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust base(1)


*one graph for expansions
margins, at(lag1_p_lnumexp=(0(1)3) lag1_p_lnumcut=0 ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0) pr(outcome(0)) pr(outcome(1))

marginsplot, ///
ytitle("Probability of voting, %", axis(1) size(medium) height(5)) ///
xtitle("expansions", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60", angle (0) labsize(medium)) ///
legend(order(1 "Opposition" 2 "Government") rows(2)) ///
title("", size(medsmall) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs12)) ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(triangle)) ///
unique name("p_lnumexp_dummy_n_bw", replace)


*one graph for cutbacks
margins, at(lag1_p_lnumcut=(0(1)3) lag1_p_lnumexp=0 ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0) pr(outcome(0)) pr(outcome(1))

marginsplot, ///
ytitle("Probability of voting, %", axis(1) size(medium) height(5)) ///
xtitle("cutbacks", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60", angle (0) labsize(medium)) ///
legend(order(1 "Opposition" 2 "Government") rows(2)) ///
title("", size(medsmall) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs12)) ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(triangle)) ///
unique name("p_lnumcut_dummy_n_bw", replace)


*for combination
grc1leg p_lnumexp_dummy_n_bw p_lnumcut_dummy_n_bw, graphregion(color(white)) ycommon ///
title("Dummy Specification", size(medium) color(black)) name("p_dummy_bw", replace)



***specification of dep. variable: separation of HoG and junior partner, appears as right-hand column in Table B9
mlogit govparty3 lag1_p_lnumexp lag1_p_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust base(1)


*one graph for expansions
margins, at(lag1_p_lnumexp=(0(1)3) lag1_p_lnumcut=0 ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0) pr(outcome(0)) pr(outcome(1)) pr(outcome(2))


*bw
marginsplot, ///
ytitle("Probability of voting, %", axis(1) size(medium) height(5)) ///
xtitle("expansions", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60" , angle (0) labsize(medium)) ///
legend(order(1 "Opposition" 2 "Chancellor's Party" 3 "Junior Coalition Partner") rows(2)) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs10)) ci3opts(color(gs14))  ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(diamond)) plot3opts(lcolor(gs12)  lpattern(dash) mcolor(gs12) msymbol(triangle)) ///
unique name("p_lnumexp_coa_n_bw", replace)


*one graph for cuts
margins, at(lag1_p_lnumexp=0 lag1_p_lnumcut=(0(1)3) ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0) pr(outcome(0)) pr(outcome(1)) pr(outcome(2))


*bw
marginsplot, ///
ytitle("Probability of voting, %", axis(1) size(medium) height(5)) ///
xtitle("cutbacks", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60" , angle (0) labsize(medium)) ///
legend(order(1 "Opposition" 2 "Chancellor's Party" 3 "Junior Coalition Partner") rows(2)) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs10)) ci3opts(color(gs14))  ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(diamond)) plot3opts(lcolor(gs12)  lpattern(dash) mcolor(gs12) msymbol(triangle)) ///
unique name("p_lnumcut_coa_n_bw", replace)


*for combination of graphs
grc1leg p_lnumexp_coa_n_bw p_lnumcut_coa_n_bw, graphregion(color(white)) ycommon ///
title("Separation of Chancellor's Party", size(medium) color(black)) name("p_coa_bw", replace)

graph combine p_dummy_bw p_coa_bw , graphregion(color(white)) ycommon ///
title("", size(medium) color(black)) cols(2) name("test_bw", replace)

*creation of Figure B4
graph combine p_base2_bw p_coa_bw p_dummy_bw, graphregion(color(white)) xcommon ///
title("Results for different specification of dependent variable", size(medium) color(black)) cols(3) name("p_dv_bw", replace)

graph save "p_dv_bw" "F:\WSCEP\Governance Paper with PB data\Figure B4.gph", replace


*****Labour market******
***labour market reform as in main text, appears as left-hand column in Table B10
mlogit defection lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust 


*dummy: government vs opposition, appears as middle-column in Table B10
mlogit govparty lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust base(1)


*separation of HoG and junior partner, appears as right-hand colum in Table B10
mlogit govparty3 lag1_ub_lnumexp lag1_ub_lnumcut class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust base(1)



***********************************************************************************************
*these analyses provide a further robustness check with a different specification of the dependent variable, where
*we subtracted the number of cuts from the number of expansions to gauge the net effect of reforms, i.e. whether a given month included more expansions resp cutbacks on balance
*difference expansions-cutbacks as alternative independent variable

*pensions
gen lag1_p_direction=lag1_p_lnumexp-lag1_p_lnumcut

mlogit defection lag1_p_direction class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust


*one graph
margins, at(lag1_p_direction=(-3(1)3) ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1) pr(outcome(1)) pr(outcome(3))

*bw
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("Difference expansions-cutbacks in month before", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .2 "20" .25 "25", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs12)) ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(triangle)) ///
unique name("p_base_diff", replace)



*unemployment benefits
gen lag1_ub_direction=lag1_ub_lnumexp-lag1_ub_lnumcut

mlogit defection lag1_ub_direction class_2 class_3 class_4 class_5 class_6 occ_2 occ_3 occ_4 occ_6 unionv74 i.age sex edu_1 edu_2 i.religion d1_unemp_month lag1_gdp_q cost singleevent i.gov_comp, robust


*one graph
margins, at(lag1_ub_direction=(-3(1)3) ///
class_2=1 class_3=0 class_4=0 class_5=0 class_6=0 ///
occ_2=0 occ_3=0 occ_4=0 occ_6=0 unionv74=0 age=2 sex=0 edu_1=0 edu_2=0 religion=2 singleevent=0 gov_comp=1) pr(outcome(1)) pr(outcome(3))

*bw
marginsplot, ///
ytitle("Probability of switching, %", axis(1) size(medium) height(5)) ///
xtitle("Difference expansions-cutbacks in month before", size(medium) color(black) height(5)) ///
ylabel(0 "0" .05 "5" .1 "10" .15 "15" .2 "20" .25 "25", angle (0) labsize(medium)) ///
legend(order(3 "Defector" 4 "Rewarder")) ///
title("", size(medium) color(black) height(5)) ///
graphregion(color(white)) bgcolor(white) recast(line) recastci(rarea) ci1opts(color(gs4) fintensity(60)) ci2opts(color(gs12)) ///
plot1opts(lcolor(black) mcolor(black) msymbol(square)) plot2opts(lcolor(gs8) lpattern(dash) mcolor(gs8) msymbol(triangle)) 
unique name("ub_base_diff", replace)